<?php

  echo "<tr ><td colspan=3>";
  
  //echo "<div style='position:absolute; top:50px;'>";
  
    if( $user_from->is_fake == 1 ) 
    {
      echo "<span style='color:red;'>Moderator user: $user_from->username </span><br/>";
    }
    else {
      echo "User: $user_from->username <br/>";
    } 
    
      echo "<input type='hidden' value='{$user_from->id}' id='from_id' />";
      
      echo lang('zip_code');
      echo ": ";
      echo $user_from->zip_code;
      echo "<br/>";
      echo lang('age') . ":" . $user_from->age;
      echo "<br/>";
      echo lang('coins');
      echo ": ";
      echo $user_from->coins;
      echo "<br/>";
//      echo "</td>";
//      echo "<td>";
//     
//      echo " </td>";
//      echo "<td>";
      echo lang('description');
      echo ": ";
      echo "<textarea id='description_{$user_from->id}' style='float: left; width:250px; height:60px; overflow:auto;'>{$user_from->description}</textarea>";
      //echo " </td>";<td></br>
      //echo "</br><a alt='Save description'   href='javascript:void(null)' onclick='save_description($user_from->id)' ><img  id='save_dscr_img' title='Save description' src='".base_url()."img/icons/Save.png'/></a></td>";
      echo "<div class='clr'></div>";
      echo "<input type='button' onclick='save_description($user_from->id)' value='".lang('save')."' />";
      
      
    
    
    echo "</td><td valign=top>";
    
    if( $user_to->is_fake == 0 ) 
    {
      echo "User: $user_to->username <br/>";
    }
    else
    {
      echo "<span style='color:red;'>Moderator User: $user_to->username </span><br/>";
    }
      echo "<input type='hidden' value='{$user_to->id}' id='to_id' />";
      //echo "<tr><td colspan=3>";
      echo lang('zip_code');
      echo ": ";
      echo $user_to->zip_code;
      echo "<br/>";
      echo lang('age') . ":" . $user_to->age;
      echo "<br/>";
      echo lang('coins');
      echo ": ";
      echo $user_to->coins;
      echo "<br/>";
      
      echo lang('description');
      echo ": <br/>";
      echo "<textarea id='description_{$user_to->id}' style='float: left; width:250px; height:60px; overflow:auto;'>{$user_to->description}</textarea>";
      echo "<div class='clr'></div>";
      //echo " </td>";<td></br>
      //echo "<a alt='Save description'   href='javascript:void(null)' onclick='save_description($user_to->id)' ><img  id='save_dscr_img' title='Save description' src='".base_url()."img/icons/Save.png'/></a><br/><br/></td>";
      echo "<input type='button' onclick='save_description($user_to->id)' value='".lang('save')."' />";
//      echo "</td>";
//      echo "<td>";
//     
//      echo " </td>";
//      echo "<td>";
      
    //echo "</div>";
      
    echo "</br></td></tr>\n";
    
    //echo "<tr style='height: 220px;'><td colspan=4></td></tr>";
    
if (count($messages) > 0)
    foreach ($messages as $row) {
        echo "<tr>\n";
        if( $row->image_name_from != NULL )            
             $image = "<img src='".base_url()."profile/image/thumb/{$row->from}/{$row->image_name_from}' alt='{$row->username_from}'>";            
           else
             $image = "<img src='".base_url()."img/no_photo.gif' alt=''>";
        echo "<td>".$image;
        echo "<a href='javascript: view_user_activity({$row->from})' >{$row->username_from}</a></td>";
        echo "<td class='dd'> <=> </td>";
        if( $row->image_name_to != NULL )            
             $image = "<img src='".base_url()."profile/image/thumb/{$row->to}/{$row->image_name_to}' alt='{$row->username_to}'>";            
           else
             $image = "<img src='".base_url()."img/no_photo.gif' alt=''>";
        echo "<td>".$image;
        echo "<a href='javascript: view_user_activity({$row->to})' >{$row->username_to}</a></td>";
        echo "<td><span>" . $row->time . "</span><br/>";
        echo "<p style='width:350px;'>" . $row->content . "</p></td>";
        echo "</tr>\n\n";
    }
else
echo "<tr><td>" . lang('no_conversations') . "</td></tr>";
?>
